package com.cys.dm.controller;

import com.cys.dm.rest.service.DmSchedulerSeatService;
import com.cys.dm.vo.CommonResponse;
import com.cys.dm.vo.VoUtil;
import com.cys.dm.vo.scheduler.DmSchedulerSeatResponse;
import com.cys.dm.vo.scheduler.SchedulerSeatVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author blue_t
 * @date 2020-12-23 10:23
 */
@RestController
public class DmChooseSeatController {

    @Autowired
    private DmSchedulerSeatService dmSchedulerSeatService;

    /**
     * 根据排期ID和剧场ID查询座位信息
     * @param map 排期ID
     * @return
     */
    @PostMapping(path = {"seat/getSchedule"})
    public CommonResponse<DmSchedulerSeatResponse> getSchedule(@RequestBody Map<String,Long> map) {
        DmSchedulerSeatResponse scheduleVo = dmSchedulerSeatService.getSchedule(map);
        return VoUtil.returnSuccess("查询座位成功！",scheduleVo);
    }

    @PostMapping(path = "seat/getSeatList")
    public CommonResponse<SchedulerSeatVo> getSeatList(@RequestBody Map<String,Long> map){
        return VoUtil.returnSuccess("获取座位信息",dmSchedulerSeatService.getSeatList(map));
    }

}
